﻿using Anke.SHManage.Model;
using Anke.SHManage.MSSQLDAL;
using Anke.SHManage.Utility;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Anke.SHManage.BLL
{
    public partial class C_OilCardRefuelBLL : BaseBLL<C_OilCardRefuel>
    {
        private C_OilCardRefuelDAL dal = new C_OilCardRefuelDAL();

        //查询油卡列表
        public object GetRefuelList(int page, int rows, string start, string end, string center, string station, string cardCode, string actualCode, string ambulanceNumber,
                                    string oilType, string shift, E_StatisticsPermisson em, string selfWorkCode,string selfName, string selfCenterID, string selfStationID)
        {
            return dal.GetRefuelList(page, rows, start, end, center, station, cardCode, actualCode, ambulanceNumber
                                     , oilType, shift , em, selfWorkCode,selfName, selfCenterID, selfStationID); 
        }
        //取C_OilCardRecharge表中id最大的一条数据
        public List<C_OilCardRefuel> GetMaxID()
        {
            string sql = @" select * from C_OilCardRefuel where id in (select max(id) from C_OilCardRefuel)";
            return base.DALContext.IC_OilCardRefuelDAL.ExcuteSqlToList(sql);
        }

        //根据车牌号码查出车辆编号和车辆编码,分中心，分站
        public C_OilCardLink GetActualCodeLinkList(string actualCode)
        {
            return dal.GetActualCodeLinkList(actualCode);
        }
        //根据车辆编号查出车牌号码和车辆编码，分中心，分站
        public C_OilCardLink GetAmbulanceNumberLinkList(string ambulanceNumber)
        {
            return dal.GetAmbulanceNumberLinkList(ambulanceNumber);
        }

        //取车牌号码(有效且没报废的)
        public object GetActualCodeList(E_StatisticsPermisson em, string selfWorkCode, string selfCenterID, string selfStationID)
        {
            return dal.GetActualCodeList(em, selfWorkCode, selfCenterID, selfStationID);
        }
        //取车牌号码(所有的)
        public object GetAllActualCodeList()
        {
            return dal.GetAllActualCodeList();
        }
        //取车辆编号(有效且没报废的)
        public object GetAmbulanceNumberList(E_StatisticsPermisson em, string selfWorkCode, string selfCenterID, string selfStationID)
        {
            return dal.GetAmbulanceNumberList(em, selfWorkCode, selfCenterID, selfStationID);
        }
        //取车辆编号(所有的)
        public object GetAllAmbulanceNumberList()
        {
            return dal.GetAllAmbulanceNumberList();
        }
        //取加油油号
        public object GetOilTypeList()
        {
            return dal.GetOilTypeList();
        }
        //取班次
        public object GetShiftList()
        {
            return dal.GetShiftList();
        }
        //取班次
        public object GetRepairTypeList()
        {
            return dal.GetRepairTypeList();
        }
        //取加油人
        public object GetRefuelPersonList()
        {
            return dal.GetRefuelPersonList();
        }
    }
}
